package com.wkq.move.module.tv.ui.adapter

import android.content.Context
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.wkq.lib_base.adapter.KtDataBindingAdapter
import com.wkq.lib_base.adapter.KtDataBindingViewHolder
import com.wkq.move.R
import com.wkq.move.databinding.ItemTvActorBinding
import com.wkq.move.databinding.ItemTvSiteBinding
import com.wkq.net.model.UsTvDetailInfo

/**
 *
 * 作者:吴奎庆
 *
 * 时间:2020/5/20
 *
 * 用途:
 */


class TvActorAdapter(context: Context, layoutId: Int) :
    KtDataBindingAdapter<UsTvDetailInfo.ActorInfo>(context, layoutId) {

//    var listener : OnItemClickListener ? =null
//
//    fun setOnItemClickListener(listener : OnItemClickListener){
//        this.listener=listener
//    }

    override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
        super.onBindViewHolder(holder, position)
        var ktDataBindingViewHolder = holder as KtDataBindingViewHolder
        var itemTvActorBinding = ktDataBindingViewHolder.getBinding() as ItemTvActorBinding
        itemTvActorBinding.data = getItem(position)
        Glide.with(mContext).load(getItem(position)?.actorPic).into(itemTvActorBinding.ivActor)
        if (viewClickListener != null) {
            viewClickListener!!.onViewClick(itemTvActorBinding.root, getItem(position))
        }


    }

//    interface  OnItemClickListener{
//        fun onItemClick (program: UsTvDetailInfo.PlayOnLineInfo?)
//    }


}

